/*
 * Binary.h
 *
 *  Created on: 29.04.2012
 *      Author: Eugene Kornykhin
 */

#ifndef OPERATION_H_
#define OPERATION_H_

#include <string>
#include "../PElement.h"
#include "Binary.h"
#include "Unary.h"
using namespace std;

//class Operation
//{
//public:
//	virtual const PElement &execute(const PElement &, const PElement &) const = 0;
//	virtual Operation *clone() const = 0;
//	virtual string toString() const = 0;
//	virtual ~Operation() {}
//};

class Addition : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);

public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Subtraction : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Equality : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class NotEquality : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Less : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class NotLess : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Greater : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class LessOrEq : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Multiplication : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Division : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Modulo : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Conjunction : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Disjunction : public Binary
{
protected:
	void push_operation_result(Interpreter &, const PElement &, const PElement &);
public:
	virtual Binary *clone(const Poliz &) const;
	virtual string toString() const;
};

class Negation : public Unary
{
protected:
	void push_operation_result(Interpreter &, const PElement &);
public:
	virtual Unary *clone(const Poliz &) const;
	virtual string toString() const;
};

#endif /* OPERATION_H_ */
